package wjl.project.dubboelabauthapi;

import lombok.Builder;
import lombok.Data;

import java.io.Serializable;


public class ResultUtil {
    @Builder
    @Data
    public static class Result implements Serializable {
        private String message;
        private int code;
    }
    public final static int SUCCESS_CODE  = 20000;

    public final static int FAIL_CODE  = 50000;


    public final static Result REGISTER_SERVER_ERROR =  Result.builder().code(40000).message("注册失败,服务器发生未知错误").build();
    public final static Result REGISTER_PHONE_INVALID  = Result.builder().code(40001).message("注册失败，手机号码不规范").build();
    public final static Result REGISTER_PASSWORD_INVALID  = Result.builder().code(40002).message("注册失败,密码不规范").build();
    public final static Result REGISTER_USERNAME_INVALID  = Result.builder().code(40003).message("注册失败，用户名不规范").build();
    public final static Result REGISTER_MAIL_INVALID  = Result.builder().code(40004).message("注册失败,电子邮箱不规范").build();
    public final static Result REGISTER_ID_INVALID  = Result.builder().code(40005).message("注册失败，用户ID不规范").build();
    public final static Result REGISTER_PHONE_EXIST  = Result.builder().code(40006).message("注册失败，用户手机号已存在").build();
    public final static Result REGISTER_MAIL_EXIST  = Result.builder().code(40007).message("注册失败，用户邮箱已存在").build();
    public final static Result REGISTER_VALID = Result.builder().code(40010).message("注册成功").build();


    public final static Result LOGIN_PHONE_CODE_SEND =  ResultUtil.Result.builder().message("验证码成功发送").code(40020).build();
    public final static Result LOGIN_PHONE_CODE_SENT =  ResultUtil.Result.builder().message("验证码已经发送，请等待一分钟后再重新验证").code(40021).build();


    public final static Result LOGIN_PHONE_CODE_INVALID = Result.builder().code(40021).message("登录失败，短信验证码不一致").build();
    public final static Result LOGIN_SUCCESS = Result.builder().code(40030).message("登录成功").build();


    public final static Result SEARCH_INVALID = Result.builder().code(43000).message("查询失败,服务器发生未知错误").build();

    public final static Result SEARCH_USER_INVALID = Result.builder().code(43001).message("查询失败,没有找到该用户").build();

}
